Completed
Pull Request — master (#66)
by
unknown
02:04
created

tructure.editStructure()ꞌ)   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 10
rs 9.4285
c 2
b 0
f 0
1
import chai from 'chai'
2
import path from 'path'
3
import sinonChai from'sinon-chai'
4
chai.use(sinonChai)
5
import sinon from 'sinon'
6
import execPromise from 'child-process-promise'
7
import mkdirp from 'mkdirp'
8
import events from 'events'
9
import {
10
  cmsStructure,
11
  abeExtend,
0 ignored issues
show
Unused Code introduced by
The variable abeExtend seems to be never used. Consider removing it.
Loading history...
12
  coreUtils,
13
  config
14
} from '../../../src/cli'
15
16
config.set({root: path.join(process.cwd(), 'test','fixtures')})
17
18
describe('cmsStructure', function() {
19
20
  var folderPath = '/my/folder/path'
21
  
22
  /**
23
   * cmsStructure.structure.editStructure
24
   * 
25
   */
26
  it('cmsStructure.structure.editStructure()', function() {
27
    this.sinon = sinon.sandbox.create();
28
    var stub = sinon.stub(coreUtils.file, "removeFolder")
29
    stub.returns('')
30
    var result = cmsStructure.structure.editStructure('remove', folderPath)
31
    chai.expect(result).to.not.be.undefined
0 ignored issues
show
introduced by
The result of the property access to chai.expect(result).to.not.be.undefined is not used.
Loading history...
32
    chai.expect(result).to.equal(folderPath)
33
    sinon.assert.calledOnce(coreUtils.file.removeFolder)
34
    coreUtils.file.removeFolder.restore()
35
  });
36
37
});
38